package lium.lbs.lbsim.chat

import android.content.Intent
import android.os.Bundle
import android.view.View
import lium.lbs.lbsim.R
import lium.lbs.lbsim.activity.FriendDetailActivity
import lium.lbs.lbsim.activity.GroupDetailActivity

class ChatActivity : ChatBaseActivity(){
    override fun onCreate(savedInstanceState: Bundle?) {
        fitsystemwindows = true
        super.onCreate(savedInstanceState)
    }
    var chatType = 0  //聊天类型 0是好友 1是群

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        setTitleWithBack("妹子")
        chatType = intent.getIntExtra("chatType",0)
        if (chatType==1){
            setTitleWithBack("临沂设计交流群")
        }
    }

    override fun onClick(v: View?) {
        super.onClick(v)
        when(v!!.id){
            R.id.right_img -> {
                if (chatType==1){
                    //群详情
                    val intent = Intent(this, GroupDetailActivity::class.java)
                    startActivity(intent)
                }else{
                    //个人详情
                    val intent = Intent(this, FriendDetailActivity::class.java)
                    startActivity(intent)
                }

            }
        }
    }
}